#include<iostream>
#include<string>
using namespace std;
string s;
string k;


int main()
{
	cin >> k;
	for (int i = 0;i < k.size();i++)
	{
		if (k[i] >= 'A' && k[i] < 'a') k[i] += ('a' - 'A');
	}

	getchar();//别忘了弄掉空格！！！
	getline(cin, s);
	for (int i = 0;i < s.size();i++)
	{
		if (s[i] >= 'A' && s[i] < 'a') s[i] += ('a' - 'A');
	}

	k = " " + k + " ";
	s = " " + s + " ";//必须这样处理不然判断不了单词在最开始的情况
	int pos = s.find(k);
	int retp = pos;
	if (pos == -1)
	{
		cout<<-1<<endl;
	}
	else
	{
		
		int ret = 1;
		while (s.find(k,pos+1) != -1)
		{
			pos = s.find(k, pos + 1);
			ret++;
		}
		cout << ret << " ";
		cout << retp << endl;
	}
	return 0;
}
